'use strict'

module.exports = {
	up: async (queryInterface, Sequelize) => {
		const { INTEGER, DATE, STRING, TEXT } = Sequelize
		await queryInterface.createTable('articles', {
			id: { type: INTEGER, primaryKey: true, autoIncrement: true },
			_title: STRING(50),
			_cover: STRING,
			author_id: INTEGER,
			tag_id: INTEGER,
			_content: TEXT,
			_status: {
				type: INTEGER,
				defaultValue: 0,
			},
			show_home: {
				type: INTEGER,
				defaultValue: 0,
			},
			created_at: DATE,
			updated_at: DATE,
		})
	},
	down: async queryInterface => {
		await queryInterface.dropTable('articles')
	},
}
